Skip to content

dash(S8): DASHWorkSource concrete IWorkSource -- 4b .cpp bodies + dash_stratum OBJECT lib + KAT#706

Merged
frstrtr merged 3 commits into
masterfrom
dash/s8-stratum-work-source
Jul 16, 2026
Merged

dash(S8): DASHWorkSource concrete IWorkSource -- 4b .cpp bodies + dash_stratum OBJECT lib + KAT#706
frstrtr merged 3 commits into
masterfrom
dash/s8-stratum-work-source

Conversation

@frstrtr

@frstrtr frstrtr commented Jul 14, 2026

Copy link
Copy Markdown
Owner

S8 stratum leaf, unblocked by #698 (get_work capstone) merge.

Adds the concrete dash::stratum::DASHWorkSource (core::stratum::IWorkSource) that bridges the coin-agnostic core::StratumServer to DASH X11/V36 work generation + share validation.

Scope (4b bodies):

  • work_source.cpp: getters + worker registry + get_work() adapter real; get_work() routes to the EMBEDDED arm when the node-held NodeCoinState bundle is populated, else the RETAINED dashd GBT RPC fallback ([GBT-XCHECK], never removed).
  • dash_stratum OBJECT lib (linked only by c2pool-dash + the KAT; ltc/btc/doge/dgb build+ctest surfaces untouched).
  • test_dash_stratum_work_source KAT: 11/11 green locally (IWorkSource contract, config defaults, work-gen atomics, worker-registry round-trip, no-merged-chain-in-v36, dashd-fallback routing, submit-stub-rejects-without-broadcasting).
  • X11 work-assembly + share-validation held at safe defaults (sentinels) for the 4c/4d hot-path slices.

Invariants: SAFE-ADDITIVE, single-coin (src/impl/dash only), per-coin isolation held, dashd RPC fallback preserved. Rebased onto current master (bcf0187); both commits GPG-signed. Registered via gtest_add_tests AUTO + present in both build.yml --target allowlists (L117 + L267).

No self-merge -- requesting integrator verify (oracle parity vs frstrtr/p2pool-dash + full Linux x86_64 CI) then operator tap.

@frstrtr
frstrtr force-pushed the dash/s8-stratum-work-source branch 2 times, most recently from 0cf49eb to 4c4ca58 Compare July 15, 2026 04:50
frstrtr added 2 commits July 15, 2026 10:02
4a skeleton mirroring dgb::stratum::DGBWorkSource: concrete
core::stratum::IWorkSource for DASH (X11). Declares the fused
get_work() member the get_work.hpp capstone forward-refs as the
eventual DASHWorkSource::get_work(); holds the node-held coin-state
embedded arm + the always-reachable dashd GBT RPC fallback (never
removed -- safety/[GBT-XCHECK]). All work-gen/submit methods are
MVP-default; .cpp bodies + CMake OBJECT wiring + instantiation KAT
land in the follow-on 4b commit once #698 is on master.

Header-only declaration; not yet in any build target (inert). Stacked
on #698 (get_work.hpp); held per integrator until #698 lands to avoid
a stacked-PR auto-close.
Stage 4b for the DASHWorkSource stratum accept-loop seam (follow-on to the
4a header skeleton). Gives the concrete core::stratum::IWorkSource a linkable
definition so it is INSTANTIABLE and holdable via shared_ptr<IWorkSource> by a
future core::StratumServer, before the substantive X11 work-assembly lands.

work_source.cpp (new):
  - constructor binding the NON-OWNING NodeCoinState reference (embedded arm),
    the REQUIRED dashd getblocktemplate fallback closure (GBT-XCHECK safety,
    never removed), and the dual-path won-block submit callback;
  - real bodies: get_best_share_hash_fn / set_best_share_hash_fn (locked),
    has_merged_chain (false, standalone X11), the per-connection worker
    registry (register/update/unregister, idempotent on unknown sessions);
  - fused get_work() adapter over the free dash::stratum::get_work() capstone
    (#698): embedded when the coin-state is populated, retained dashd fallback
    on a set-gap;
  - work-generation / coinbase / mining_submit / compute_share_difficulty held
    at documented SAFE DEFAULTS (empty template, reject, 0.0 sentinel) for
    4c/4d -- mirrors dgb::stratum::DGBWorkSource 4a->4b->4c->4d progression.

dash_stratum OBJECT lib (stratum/CMakeLists.txt + add_subdirectory): SAFE-ADDITIVE,
compiled here, linked only by the KAT now (and c2pool-dash in a later slice), so
ltc/btc/doge/dgb build + ctest surfaces stay untouched. Per-coin isolation held:
src/impl/dash only, dashd RPC fallback preserved.

test_dash_stratum_work_source (new, 11 KATs, Linux x86_64 11/11): construction +
full IWorkSource contract, config defaults, work-generation counter, share-target
atomics, worker registry, best-share callback, 4b safe-default assertions, and the
fused get_work() routing to the retained dashd fallback on an unpopulated
coin-state. Added to BOTH build.yml --target allowlists (NOT_BUILT sentinel guard).
@frstrtr
frstrtr merged commit 1737f37 into master Jul 16, 2026
27 checks passed
@frstrtr
frstrtr deleted the dash/s8-stratum-work-source branch July 16, 2026 10:45
frstrtr added a commit that referenced this pull request Jul 16, 2026
…HWorkSource standup

Closes the S8 "no run-path caller" gap: the DASHWorkSource IWorkSource
seam (#706, 4a skeleton + 4b bodies) and the subscribe->notify->submit
KATs (#630-634) had no production caller — a real main that constructs
the work source and binds a core::StratumServer to it. This is that
caller.

- main_dash.cpp: --stratum [HOST:]PORT argv (SSOT parse_listen); threaded
  into run_node; node_coin_state -> DASHWorkSource -> StratumServer
  standup; won-block dispatch via the EXISTING dashd-RPC submitblock arm
  (rpc->submit_block_hex) — embedded P2P relay leg stays S8; UNARMED path
  logs loudly, never a silent drop. Destruction order: stratum_server
  declared before the work source it references; explicit reset() after
  ioc.run(). dashd-RPC fallback RETAINED (never removed).
- src/c2pool/CMakeLists.txt: link dash_stratum into c2pool-dash (the 4b
  work_source.cpp bodies) — without it the executable failed to link
  (undefined DASHWorkSource ctor). Build-glue for the caller.

Verified Linux x86_64: c2pool-dash links clean; --run --stratum
127.0.0.1:13333 stands up the acceptor (DASHWorkSource constructed,
StratumServer bound, clean stop). subscribe->notify->submit binding is
KAT-covered at the work_source seam (#630-634). No other-coin / shared-
base edit; per-coin isolation held.
frstrtr added a commit that referenced this pull request Jul 16, 2026
…HWorkSource standup

Closes the S8 "no run-path caller" gap: the DASHWorkSource IWorkSource
seam (#706, 4a skeleton + 4b bodies) and the subscribe->notify->submit
KATs (#630-634) had no production caller — a real main that constructs
the work source and binds a core::StratumServer to it. This is that
caller.

- main_dash.cpp: --stratum [HOST:]PORT argv (SSOT parse_listen); threaded
  into run_node; node_coin_state -> DASHWorkSource -> StratumServer
  standup; won-block dispatch via the EXISTING dashd-RPC submitblock arm
  (rpc->submit_block_hex) — embedded P2P relay leg stays S8; UNARMED path
  logs loudly, never a silent drop. Destruction order: stratum_server
  declared before the work source it references; explicit reset() after
  ioc.run(). dashd-RPC fallback RETAINED (never removed).
- src/c2pool/CMakeLists.txt: link dash_stratum into c2pool-dash (the 4b
  work_source.cpp bodies) — without it the executable failed to link
  (undefined DASHWorkSource ctor). Build-glue for the caller.

Verified Linux x86_64: c2pool-dash links clean; --run --stratum
127.0.0.1:13333 stands up the acceptor (DASHWorkSource constructed,
StratumServer bound, clean stop). subscribe->notify->submit binding is
KAT-covered at the work_source seam (#630-634). No other-coin / shared-
base edit; per-coin isolation held.
frstrtr added a commit that referenced this pull request Jul 16, 2026
…HWorkSource standup (#715)

Closes the S8 "no run-path caller" gap: the DASHWorkSource IWorkSource
seam (#706, 4a skeleton + 4b bodies) and the subscribe->notify->submit
KATs (#630-634) had no production caller — a real main that constructs
the work source and binds a core::StratumServer to it. This is that
caller.

- main_dash.cpp: --stratum [HOST:]PORT argv (SSOT parse_listen); threaded
  into run_node; node_coin_state -> DASHWorkSource -> StratumServer
  standup; won-block dispatch via the EXISTING dashd-RPC submitblock arm
  (rpc->submit_block_hex) — embedded P2P relay leg stays S8; UNARMED path
  logs loudly, never a silent drop. Destruction order: stratum_server
  declared before the work source it references; explicit reset() after
  ioc.run(). dashd-RPC fallback RETAINED (never removed).
- src/c2pool/CMakeLists.txt: link dash_stratum into c2pool-dash (the 4b
  work_source.cpp bodies) — without it the executable failed to link
  (undefined DASHWorkSource ctor). Build-glue for the caller.

Verified Linux x86_64: c2pool-dash links clean; --run --stratum
127.0.0.1:13333 stands up the acceptor (DASHWorkSource constructed,
StratumServer bound, clean stop). subscribe->notify->submit binding is
KAT-covered at the work_source seam (#630-634). No other-coin / shared-
base edit; per-coin isolation held.

Co-authored-by: frstrtr <frstrtr@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant